$ifile = 'kfreq.txt';
$ofile = 'out.txt';
open $fh, $ifile or die;
open $ofh, "> $ofile" or die;
binmode($fh, ':encoding(utf8)');
binmode($ofh, ':encoding(utf8)');
while (<$fh>)  {
	print $ofh $_ if (m/^$/ || m/^#/);
	s/[\r\n]//;
	m/^U\+([0-9a-fA-F]+)/;
	if ($1)  {
		print $ofh $_,"\t",chr(hex($1)),"\n";
	}
}

close $fh;
close $ofh;
